package com.git_taoxian.test2;

import java.io.*;

public class Test {
    public static void main(String[] args) {
        try (       // 定义缓冲字节输入输出流对象
                    BufferedInputStream bis = new BufferedInputStream(new FileInputStream("d:/img1/1.png"));
                    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("d:/img2/2.png"));) {

//        设置每次读取的字节数
            int len;
            while ((len = bis.read()) != -1) {
                bos.write(len);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
        }
    }
}
